package com.joysuch.wwyt.patrol.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum DeviceTypeEnum {
    PRODUCTION_FACILITY("production_facility", "生产装置"),
    // STORE_AREA("", "store_area"),
    STORE_HOUSE( "store_house", "库房"),
    STORE_TANK_AREA("store_tank_area", "储罐区"),
    STORE_TANK("store_tank", "储罐"),
    MANUFACTURING_TECH("manufacturing_tech", "工艺流程");

    private String value;

    private String desc;

    DeviceTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<String, DeviceTypeEnum> lookup = new HashMap<>();

    static {
        for (DeviceTypeEnum e : EnumSet.allOf(DeviceTypeEnum.class)) {
            lookup.put(e.desc, e);
        }
    }

    public static DeviceTypeEnum find(String  desc) {
        return lookup.get(desc);
    }

}
